public class LogIn {
    private String userName = "admin";
    private String password = "123456";
    public  void loginInfo(String userName, String password) throws userNameException,passWordException {
        if (!this.userName.equals(userName)) {

            throw new userNameException("用户名错误");
        }

        if (!this.password.equals((password))) {
            throw new passWordException("密码错误");
        }
            System.out.println("登陆成功");
        }
        public static void main(String[] args) {
            LogIn logIn=new LogIn();
            try{
                logIn.loginInfo("admin1", "123456");
            }catch (userNameException e){
                System.out.println("userNameException");
            }catch (passWordException e){
                System.out.println("passWordException");
            }
        }
}
